using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using EngineGame;

namespace WarsOnRiceFields
{
    public class Screw
    {
        private int x;
        private int y;
        private Sprite sScrew;
        private float vx;
        public bool isAvailable;
        public Screw(int _x, int _y, Sprite screw)
        {
            x = _x;
            y = _y;
            sScrew = screw;
            vx = 0.1f;
            isAvailable = true;
        }
        public void Update(GameTime gameTime)
        {
            x = (int)vx * gameTime.ElapsedGameTime.Milliseconds;
            sScrew.Next(gameTime);
        }
        public void Draw(SpriteBatch sprite)
        {
            if (isAvailable)
            {
                sScrew.Position = new Vector2(x, y);
                sScrew.Draw(sprite);
            }
        }
    }
}
